import { defHttp } from '@/utils/http/axios';
import { ErrorMessageMode } from '#/axios';
enum Api {
  //设置参数状态
  setSystemparamStatus = '/systemparam/setSystemparamStatus',
  //获取参数列表  
  getSystemparamList = '/systemparam/getSystemparamList',
  //添加参数  
  addSystemparam = '/systemparam',
  //修改参数  
  updateSystemparam = '/systemparam',
  //删除参数  
  deleteSystemparam = '/systemparam/',
  //获取参数  
  getSystemparam = '/systemparam/getSystemparam',
  
}
export const setSystemparamStatus = (id: number, status: number) =>{
   return defHttp.put<any>({ url: Api.setSystemparamStatus, params:{ id, status } });
}
export const getSystemparamList = (params) =>{
  return defHttp.get<any>({ url: Api.getSystemparamList, params });
}

export const getSystemparam = () =>{
  return defHttp.get<any>({ url: Api.getSystemparam, }, { errorMessageMode: 'none' });
}
export const addSystemparam = (params, mode: ErrorMessageMode = 'message') => {
    return defHttp.post<any>({ params,url: Api.addSystemparam },
      {
        errorMessageMode: mode,
      },);
  };
export const updateSystemparam = (params,mode: ErrorMessageMode = 'message')=>{
  return defHttp.put<any>({ params,url: Api.updateSystemparam },
    {
      errorMessageMode: mode,
    },)
}
export const deleteSystemparam = (params, mode: ErrorMessageMode = 'message') => {
    return defHttp.delete<any>({ params,url: Api.deleteSystemparam },
      {
        errorMessageMode: mode,
      },);
  };